<?php
class ArticleModel extends MongoModel {
    var $table  = 'article';
    var $name = '文章';
    
    public function get_articles($condition, $columns=null, $lang=null){
    	$articles = self::find($condition, $columns);
    	if($lang!==null){
	    	foreach($articles as $cate_id=>&$article){
		    	if(isset($article[$lang])){
		    		foreach($article[$lang] as $k=>$v){
		    			$article[$k] = $v;
		    		}
		    		unset($article[$lang]);
		    	}
	    	}
    	}
    	return $articles;
    }
}

?>